﻿/// Write a program that compares two text files line by line and prints the number of lines that are the same
/// and the number of lines that are different. Assume the files have equal number of lines.

using System;
using System.IO;


namespace c_sh_II_lek_6_files
{
    class zad4
    {
        static void Main()
        {
            string file1 = @"..\..\testStream1.txt";
            string file2 = @"..\..\testStream2.txt";
            int equalsLines = 0;
            int diffLines = 0;


            using (StreamReader stream1 = new StreamReader(file1))
            {
                using (StreamReader stream2 = new StreamReader(file2))
                {
                    string line1 = stream1.ReadLine();
                    string line2 = stream2.ReadLine();
                    
                    while (line1 != null)
                    {
                        if (line1 == line2)
                        {
                            equalsLines++;
                        }
                        else
                        {
                            diffLines++;
                        }

                        line1 = stream1.ReadLine();
                        line2 = stream2.ReadLine();
                    } 
                }
            }

            Console.WriteLine("Equal Lines {0}, Different Lines {1}", equalsLines, diffLines);
        }
    }
}
